<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j" xmlns:p="http://primefaces.org/ui"
	xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/adminTheme.xhtml">
	<ui:define name="content-header">
		<section class="content-header">
			<h1>
				Add Subject <small>Manager Subject</small>
			</h1>
			<ol class="breadcrumb">
				<li><a href="#{request.contextPath}/admin/dashboard.html"><i
						class="fa fa-dashboard"></i>Home</a></li>
				<li><a href="#{request.contextPath}/admin/subject/view.html">Manager Subject</a></li>
				<li class="active">Add Subject</li>
			</ol>
		</section>
	</ui:define>
	<ui:define name="content-main">
		<!-- Small boxes (Stat box) -->
		<div class="row">
			<div class="col-md-12">
				<h:form  id="form-add-code">
					<div class="box box-primary">
						<div class="box-header">
							<h3 class="box-title">New Subject</h3>
							<p:messages id="messages" showDetail="true" autoUpdate="true"
								closable="true" />
						</div>
						<div class="box-body">
							<div class="form-group">
								<h:outputLabel value="Import File Excel:" />
								<p:fileUpload fileUploadListener="#{sab.upLoadFile}"
									mode="advanced" update="messages select-add" auto="true" ></p:fileUpload>
							</div>
							
							<h:panelGroup id="select-add">
							<div class="form-group" style="#{sab.visitInput}">
								<h:outputLabel value="ID:" for="no" />
								<h:inputText styleClass="form-control" id="no" value="#{sab.add.subjectNo}" pt:required="required"
									pt:placeholder="CNPM" />
							</div>
							<div class="form-group" style="#{sab.visitInput}">
								<h:outputLabel value="Name:" />
								<h:inputText styleClass="form-control" id="codeName" value="#{sab.add.subjectName}"
 									pt:placeholder="Công Nghệ Phần Mềm" pt:required="required" />
							</div>

							<div class="panel panel-default" style="#{sab.visitListCode}">
								<div class="panel-heading">Choose :</div>
								<p:dataTable var="s"  value="#{sab.adds}" id="table-add-code" selection="#{sab.select}" rowKey="#{s.subjectNo}" style="margin-bottom:0">
									<p:column selectionMode="multiple" style="width:40px;text-align:center" />
								
									<p:column headerText="ID" style="width:30%;text-align:center" >
										<h:outputText value="#{s.subjectNo}" />
									</p:column>
									<p:column headerText="Code Name" style="width:60%" >
										<h:outputText value="#{s.subjectName}" />
									</p:column>
								</p:dataTable>
							</div>
							</h:panelGroup>
						</div>
						<!-- /.box-body -->

						<div class="box-footer">
							<p:commandButton action="#{sab.add}"
								styleClass="btn btn-primary" value="Add" update="messages">
							</p:commandButton>
						</div>



					</div>
				</h:form>
				<!-- /.box -->
			</div>
		</div>
		<!-- /.row (main row) -->

	</ui:define>

</ui:composition>
